package com.edisoncgh;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import java.util.Calendar;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class TimerTest {
    @ParameterizedTest
    @CsvSource({
            "Jan 01 00:00:00, Jan 01 00:01:00, 0.05",
            "Feb 02 01:01:01, Feb 02 01:10:01, 0.45",
            "Jun 15 12:30:30, Jun 15 13:00:30, 1.1",
            "Nov 28 22:50:50, Nov 28 23:50:50, 1.4",
            "Dec 31 23:59:59, Jan 01 01:00:00, 1.4"
    })
    public void normalTest(Calendar t1, Calendar t2, double excepted) {
        Timer timer = new Timer();
        double res = timer.calculatePhoneCallConsumption(t1, t2);
        assertEquals(excepted, res);
    }
}
